# install docker
apt-get remove docker docker-engine docker.io containerd runc
apt-get update
apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    gnupg \
    lsb-release
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo \
  "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io


## vim /etc/systemd/system/docker.service.d/http-proxy.conf
## vim /etc/systemd/system/containerd.service.d/http-proxy.conf
## vim /etc/docker/daemon.json

## [Service]
## Environment="HTTP_PROXY=http://127.0.0.1:7890"
## Environment="HTTPS_PROXY=http://127.0.0.1:7890"
## Environment="NO_PROXY=localhost,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,.svc,.cluster.local,.ewhisper.cn,<nodeCIDR>,<APIServerInternalURL>,<serviceNetworkCIDRs>,<etcdDiscoveryDomain>,<clusterNetworkCIDRs>,<platformSpecific>,<REST_OF_CUSTOM_EXCEPTIONS>"

# {
#     "registry-mirrors": [
#        "https://2a6bf1988cb6428c877f723ec7530dbc.mirror.swr.myhuaweicloud.com",
#        "https://docker.m.daocloud.io",
#        "https://hub-mirror.c.163.com",
#        "https://mirror.baidubce.com",
#        "https://your_preferred_mirror",
#        "https://dockerhub.icu",
#        "https://docker.registry.cyou",
#        "https://docker-cf.registry.cyou",
#        "https://dockercf.jsdelivr.fyi",
#        "https://docker.jsdelivr.fyi",
#        "https://dockertest.jsdelivr.fyi",
#        "https://mirror.aliyuncs.com",
#        "https://dockerproxy.com",
#        "https://mirror.baidubce.com",
#        "https://docker.m.daocloud.io",
#        "https://docker.nju.edu.cn",
#        "https://docker.mirrors.sjtug.sjtu.edu.cn",
#        "https://docker.mirrors.ustc.edu.cn",
#        "https://mirror.iscas.ac.cn",
#        "https://docker.rainbond.cc"
#     ]
# }

## systemctl restart docker
## systemctl restart containerd
## systemctl daemon-reload